package view;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import java.awt.Rectangle;
import javax.swing.JTree;
import java.awt.Point;
import javax.swing.JMenuItem;
import java.awt.event.KeyEvent;
import javax.swing.*;

import java.awt.BorderLayout;
import java.awt.Container;

public class Main {
	
	private static final long serialVersionUID = 1L;
	
	private JFrame VentanaPrincipal = null;  //  @jve:decl-index=0:visual-constraint="11,20"
	private JPanel jContentPane = null;
	private JScrollPane scrollInvestigacion = null;
	private JTree treeInvestigacion = null;
	private JScrollPane scrollLectura = null;
	private JScrollPane scrollAtributo = null;
	// comienza codigo de jmenu
	/*private JMenuBar menuBar ;  
	private JMenu menu;
	private JMenuItem menuItem ;
	*/
	public Main(){
		JMenuBar menuBar =new JMenuBar();  
		JMenu menu;
		JMenuItem menuItem ;
		//setJMenuBar(menuBar);
		menu = new JMenu("Archivo");
		 menuBar.add(menu);
		 menuItem = new JMenuItem("Gaurdar");
		 menu.add(menuItem);
		 menuItem = new JMenuItem("Guardar como");
		 menu.add(menuItem);
		 menuItem = new JMenuItem("salir");
		 menu.add(menuItem);
		 menuBar.setVisible(true);
		 menu.setVisible(true); 
		//agregoMenu();
	}
	
	/**
	 * This method initializes VentanaPrincipal	
	 * 	
	 * @return javax.swing.JFrame	
	 */
	private JFrame getVentanaPrincipal() {
		if (VentanaPrincipal == null) {
			VentanaPrincipal = new JFrame();
			VentanaPrincipal.setSize(new Dimension(957, 368));
			VentanaPrincipal.setTitle("Gestor Bibliografico");
			VentanaPrincipal.setContentPane(getJContentPane());
		}
		return VentanaPrincipal;
	}

	/**
	 * This method initializes jContentPane	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getScrollInvestigacion(), null);
			jContentPane.add(getScrollLectura(), null);
			jContentPane.add(getScrollAtributo(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes scrollInvestigacion	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getScrollInvestigacion() {
		if (scrollInvestigacion == null) {
			scrollInvestigacion = new JScrollPane();
			scrollInvestigacion.setLocation(new Point(4, 44));
			scrollInvestigacion.setSize(new Dimension(200, 288));
			scrollInvestigacion.setViewportView(getTreeInvestigacion());
		}
		return scrollInvestigacion;
	}

	/**
	 * This method initializes treeInvestigacion	
	 * 	
	 * @return javax.swing.JTree	
	 */
	private JTree getTreeInvestigacion() {
		if (treeInvestigacion == null) {
			treeInvestigacion = new JTree();
		}
		return treeInvestigacion;
	}

	/**
	 * This method initializes scrollLectura	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getScrollLectura() {
		if (scrollLectura == null) {
			scrollLectura = new JScrollPane();
			scrollLectura.setLocation(new Point(227, 44));
			scrollLectura.setSize(new Dimension(500, 290));
		}
		return scrollLectura;
	}

	/**
	 * This method initializes scrollAtributo	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getScrollAtributo() {
		if (scrollAtributo == null) {
			scrollAtributo = new JScrollPane();
			scrollAtributo.setLocation(new Point(743, 44));
			scrollAtributo.setSize(new Dimension(200, 286));
		}
		return scrollAtributo;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		Main ventana = new Main();
		ventana.getVentanaPrincipal().setVisible(true);
	}
	/* private void agregoMenu(){
		 menuBar = new JMenuBar();
		// setJMenuBar(menuBar);
		 menu = new JMenu("Archivo");
		 menuBar.add(menu);
		 menuItem = new JMenuItem("Gaurdar");
		 menu.add(menuItem);
		 menuItem = new JMenuItem("Guardar como");
		 menu.add(menuItem);
		 menuItem = new JMenuItem("salir");
		 menu.add(menuItem);
		 menuBar.setVisible(true);
		 menu.setVisible(true); 
	 }*/
}
